//package com.supermap.dubbo.client.controller;
//
//import com.alibaba.fastjson.JSONObject;
//import com.supermap.dubbo.client.dubbo.DataDubboConsumerService;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.util.Map;
//
//@RestController
//@RequestMapping(value = "data")
//public class DataController {
//    @Resource
//    private DataDubboConsumerService dataDubboConsumerService;
//
//    @RequestMapping(value = "addUser", method = RequestMethod.POST)
//    @ResponseBody
//    public JSONObject addUser(@RequestBody Map<String, String> param) {
//        String name = param.get("name");
//        String age = param.get("age");
//        String sql = "insert into user(name,age) values('" + name + "','" + age + "')";
//        return dataDubboConsumerService.insertData(sql);
//    }
//
//    @RequestMapping(value = "findById")
//    @ResponseBody
//    public JSONObject findById(@RequestBody Map<String, String> param) {
//        String id = param.get("id");
//        String sql = "select * from user where id ='" + id + "'";
//        return dataDubboConsumerService.selectData(sql);
//    }
//
//    @RequestMapping(value = "updateById")
//    @ResponseBody
//    public JSONObject updateById(@RequestBody Map<String, String> param) {
//        String name = param.get("name");
//        String id = param.get("id");
//        String sql = "update user set name='" + name + "' where id='" + id + "'";
//        return dataDubboConsumerService.updateData(sql);
//    }
//
//    @RequestMapping(value = "deleteById")
//    @ResponseBody
//    public JSONObject deleteById(@RequestBody Map<String, String> param) {
//        String id = param.get("id");
//        String sql = "delete from user where id ='" + id + "'";
//        return dataDubboConsumerService.deleteData(sql);
//    }
//}
